<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>内容列表</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">	
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">	
	<meta name="apple-mobile-web-app-status-bar-style" content="black">	
	<meta name="apple-mobile-web-app-capable" content="yes">	
	<meta name="format-detection" content="telephone=no">	
	<!-- load css -->
	<link rel="stylesheet" type="text/css" href="/Public/admin/cache/css/layui.css" media="all">
	<link rel="stylesheet" type="text/css" href="/Public/admin/global.css" media="all">
	<link rel="stylesheet" type="text/css" href="/Public/admin/css/adminstyle.css" media="all">
</head>
<body>
<div id="main" class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
	<div class="layui-tab-content">
		<div class="layui-tab-item layui-show">
			<a href="/admin/Content/add/cateid/<?php echo ($cateid); ?>/modelid/<?php echo ($modelid); ?>" target="_blank"><div class="layui-btn layui-btn-radius">发布新内容</div></a>
			 <table class="layui-table">
					<colgroup>
						<col width="80">
						<col width="350">
						<col width="100">
						<col width="200">
						<col width="200">
						<col>
					</colgroup>
					<thead>
						<tr>
							<th style="text-align: center;">ID</th>
							<th style="text-align: center;">标题</th>
							<th style="text-align: center;">点击量</th>
							<th style="text-align: center;">发布时间</th>
							<th style="text-align: center;">更新时间</th>
							<th style="text-align: center;">操作</th>
						</tr>
					</thead>
					<tbody>
						<?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$mfiles): $mod = ($i % 2 );++$i;?><tr>
							<td style="text-align: center;"><?php echo ($mfiles['id']); ?></td>
							<td>
								<a href="<?php echo ($mfiles['url']); ?>" target="_blank">
									<?php if($mfiles['thumb'] != ''): ?><font color="red">[图]</font><?php endif; ?>
									<?php if(is_array($mfiles['push'])): foreach($mfiles['push'] as $key=>$vo): switch($vo): case "1": ?><font color="blue">[推]</font><?php break;?>
										    <?php case "2": ?><font color="green">[头]</font><?php break;?>
										    <?php case "3": ?><font color="purple">[幻]</font><?php break;?>
										    <?php default: endswitch; endforeach; endif; ?>
									<?php echo ($mfiles['title']); ?>
								</a>
							</td>
							<td style="text-align: center;"><?php echo ($mfiles['hits']); ?></td>
							<td align="center"><?php echo (date("Y-m-d H:i:s",$mfiles['addtime'])); ?></td>
							<td align="center"><?php echo (date("Y-m-d H:i:s",$mfiles['updatetime'])); ?></td>
							<td align="center">
									<a onclick="openurl('<?php echo ($tablename); ?>','<?php echo ($mfiles['id']); ?>')" class="layui-btn layui-btn-small layui-btn-normal">移动</a>
									<a href="/admin/content/edit/tablename/<?php echo ($tablename); ?>/id/<?php echo ($mfiles['id']); ?>" class="layui-btn layui-btn-small layui-btn-danger" target="_blank">编辑</a>
									<a href="/admin/content/del/tablename/<?php echo ($tablename); ?>/id/<?php echo ($mfiles['id']); ?>" class="layui-btn layui-btn-small">删除</a>
							</td>
						</tr><?php endforeach; endif; else: echo "" ;endif; ?>
					</tbody>
				</table>
				<div id="page" style="margin-left: 30%;"></div>
		</div>
	</div>
</div>
<script src="/Public/admin/layui/jquery-1.8.3.min.js" charset="utf-8"></script>
<script src="/Public/admin/cache/layui.js" charset="utf-8"></script>
<script type="text/javascript">
	layui.use(['laypage','layer','form'], function(){
		var layer = layui.layer,
		laypage = layui.laypage,
		form = layui.form();
		laypage({
			cont: 'page'
			,pages: <?php echo ($pages); ?>
			,skip: true
			,skin: '#c00'
			,curr: <?php echo ($page); ?>
			,jump: function(obj, first){
					//得到了当前页，用于向服务端请求对应数据
					var newurl=location.href.replace('?page='+<?php echo ($page); ?>,'')+'?page='+obj.curr;
					if (obj.curr!=<?php echo ($page); ?>) {
						window.location.href=newurl;
					}
				}
		});
	});
	function openurl(tablename,id){
	 layer.open({
		type: 2
		,title: '内容转移'
		,area: ['300px', '489px']
		,shade: 0
		,maxmin: true
		,content: '/admin/content/move/tablename/'+tablename+'/id/'+id
		,end: function(index, layero){
			location.reload();
		}
	});
}
</script>
</body>
</html>